<template>
	<view :class="[primarySize()]">
		<view class="container">
			<view class="plr30 pb30">
				<job-list :jobs="jobs"></job-list>
				<view class="nothing" v-if="jobsMore.nothing">
					<image src="https://admin.mosizp.cn/static/public/icon_nothing.png" mode="aspectFit"></image>
					<text>暂无职位</text>
				</view>
				<view class="g-btn3-wrap" v-else>
					<view class="g-btn3" @click="fetchJob()">{{jobsMore.text}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import jobList from '../../components/job-list/job-list.vue';
	const app = getApp();
	export default {
		components: {
			jobList
		},
		data() {
			return {
				jobsMore: {
					page: 1
				},
				jobs: [],
			}
		},
		onReady() {
			uni.setNavigationBarColor({
				frontColor: '#ffffff',
				backgroundColor: this.primaryColor()
			})
		},
		created() {
			let page = this;
			this.fetchJob();
		},
		onReachBottom() {
			this.fetchJob()
		},
		methods: {
			fetchJob() {
				this.$util.fetch(this, 'xilujob.job/recommend_jobs', {}, 'jobsMore', 'jobs',  'jobs', 'unique');
			},

		}
	}
</script>

<style>

</style>